using ASP;
using HoWave.Common;
using System;
using System.Web.Profile;
using System.Web.UI;
using System.Web.UI.WebControls;
public class UserControls_ProductTextFormat : UserControl
{
	protected Label LeftTime;
	protected Literal outText1;
	protected Label TeamMinPrice;
	protected Literal outText2;
	protected Label AuctionStartPrice;
	protected Label OICQ;
	protected Label Skype;
	protected Label Msn;
	protected Label Yahoo;
	protected Label Taobaowangwang;
	protected string _Text = string.Empty;
	protected string _ProductType = string.Empty;
	protected string _Value = string.Empty;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	public string Text
	{
		get
		{
			return this._Text;
		}
		set
		{
			this._Text = value;
		}
	}
	public string ProductType
	{
		get
		{
			return this._ProductType;
		}
		set
		{
			this._ProductType = value;
		}
	}
	public string Value
	{
		get
		{
			return this._Value;
		}
		set
		{
			this._Value = value;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		string text = this._Text;
		switch (text)
		{
		case "LeftTime":
			this.LeftTime.Visible = true;
			break;
		case "TeamMinPrice":
			if (this._ProductType == "3")
			{
				this.outText1.Text = this._Value.ToString();
				this.TeamMinPrice.Visible = true;
			}
			break;
		case "AuctionStartPrice":
			if (this._ProductType == "2")
			{
				this.outText2.Text = this._Value.ToString();
				this.AuctionStartPrice.Visible = true;
			}
			break;
		case "OICQ":
			if (this._Value != string.Empty && this._Value != null && this._Value != "")
			{
				this.OICQ.Visible = true;
			}
			break;
		case "Skype":
			if (this._Value != string.Empty && this._Value != null && this._Value != "")
			{
				this.Skype.Visible = true;
			}
			break;
		case "Msn":
			if (this._Value != string.Empty && this._Value != null && this._Value != "")
			{
				this.Msn.Visible = true;
			}
			break;
		case "Yahoo":
			if (this._Value != string.Empty && this._Value != null && this._Value != "")
			{
				this.Yahoo.Visible = true;
			}
			break;
		case "Taobaowangwang":
			if (this._Value != string.Empty && this._Value != null)
			{
				this.Taobaowangwang.Visible = true;
			}
			break;
		}
	}
	protected int GetDay(int flag)
	{
		int result;
		if (this._Value != string.Empty && HoWave.Common.Text.IsNumber(this._Value))
		{
			int num;
			if (flag == 1)
			{
				num = (int)Math.Ceiling(Convert.ToDouble(this._Value) / 3600.0 / 24.0);
			}
			else
			{
				num = Convert.ToInt32(this._Value) / 3600 / 24;
			}
			if (num < 0)
			{
				num = 0;
			}
			result = num;
		}
		else
		{
			result = 0;
		}
		return result;
	}
	protected int GetMonth(int flag)
	{
		int result;
		if (this._Value != string.Empty && HoWave.Common.Text.IsNumber(this._Value))
		{
			int num;
			if (flag == 1)
			{
				num = (int)Math.Ceiling(Convert.ToDouble(this._Value) / 3600.0 / 24.0 / 30.0);
			}
			else
			{
				num = Convert.ToInt32(this._Value) / 3600 / 24 / 30;
			}
			if (num < 0)
			{
				num = 0;
			}
			result = num;
		}
		else
		{
			result = 0;
		}
		return result;
	}
	protected int GetHour(int flag)
	{
		int result;
		if (this._Value != string.Empty && HoWave.Common.Text.IsNumber(this._Value))
		{
			int num = (int)Math.Ceiling(Convert.ToDouble(this._Value) / 3600.0);
			if (flag == 1)
			{
				num = (int)Math.Ceiling(Convert.ToDouble(this._Value) / 3600.0);
			}
			else
			{
				num = Convert.ToInt32(this._Value) / 3600;
			}
			if (num < 0)
			{
				num = 0;
			}
			result = num;
		}
		else
		{
			result = 0;
		}
		return result;
	}
}
